package org.example.cake.service.impl;

import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.example.cake.mapper.AdminMapper;
import org.example.cake.entity.Admin;
import org.example.cake.service.AdminService;
@Service
public class AdminServiceImpl implements AdminService{

    @Resource
    private AdminMapper adminMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return adminMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Admin record) {
        return adminMapper.insert(record);
    }

    @Override
    public int insertSelective(Admin record) {
        return adminMapper.insertSelective(record);
    }

    @Override
    public Admin selectByPrimaryKey(Integer id) {
        return adminMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Admin record) {
        return adminMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Admin record) {
        return adminMapper.updateByPrimaryKey(record);
    }

    /**
     * //管理员登录
     * @author 徐
     * @param username 管理员账号
     * @param password 管理员密码
     * @date 2025-07-25
     * @return 管理员对象
     */
    @Override
    public Admin adminLogin(String username, String password) {
        return adminMapper.adminLogin(username,password);
    }


}
